<script setup>
import { onMounted, nextTick, ref, reactive, watch } from 'vue'
import * as echarts from 'echarts';
import axios from "axios"
import { useRouter } from 'vue-router'
import Base from './Base.vue';

const url = "/dxc"

const router = useRouter()

// 跳转
const gob = () => {
  router.push({
    name: "kkkkkkk"
  })
}

const initEchart = async () => {
  // console.log(1);
  await nextTick(() => {
    console.log("nexttick");
  })
}

let arr = ref([1, 5, 6])

onMounted(() => {
  setInterval(() => {
    // arr.value[0]++
  }, 1000)
  // let chartDom = document.getElementById("aaa")
  // chartDom.style.display = ""
  // setTimeout(() => {
  //   chartDom.style.width = "600px"
  // }, 0)
  // setTimeout(() => {
  //   let myChart = echarts.init(chartDom);
  //   let option = {
  //     xAxis: {
  //       type: 'category',
  //       data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  //     },
  //     yAxis: {
  //       type: 'value'
  //     },
  //     series: [
  //       {
  //         data: [820, 932, 901, 934, 1290, 1330, 1320],
  //         type: 'line',
  //         smooth: true
  //       }
  //     ]
  //   };
  //   myChart.setOption(option);
  // }, 0)
})
// const testAxios=()=>{
//   axios({
//     method:"get",
//     params
//   })
// }

let num = 0
const testAdd = () => {
  for (let i = 0; i <= 10000; i++) {
    axios({
      method: "get",
      params: {
        num: i
      },
      url: url + "/test/add"
    }).then(res => {
      // res?.data?.num == 10000 && console.log(res.data.num); 
    }).catch(err => {
      console.log(i);
    })
  }
  // num++

}

const url1 = '/nodd'
const testAddNode = () => {
  for (let i = 0; i <= 3097; i++) {
    axios({
      method: "get",
      params: {
        num: i
      },
      url: url1 + "/nodeadd"
    }).then(res => {
      console.log("aa==>", res.data.num);
      // res?.data?.num == 10000 && console.log(res.data.num); 
    }).catch(err => {
      console.log(i);
    })
  }
  // num++

}

const activeItem = ref(0)
const btnClick = (index) => {
  activeItem.value = index
}

const options=reactive([
  { value: 'Burns Bay Road' },
  { value: 'Downing Street' },
  { value: 'Wall Street' },
])

const value = ref('')
const filterOption = (inputValue, option) => {
  // toUpperCase() 方法用于把字符串转换为大写。
  return option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1;
};
// the components in referencing skills are the 
</script>
<template>
  <a-auto-complete v-model:value="value" :options="options" style="width: 200px" placeholder="input here"
    :filter-option="filterOption" />


  <!-- <template v-for="item in 3">
          <a-button :style="activeItem == item ? { color: 'red' } : { color: 'blue' }" @click="btnClick(item)">{{ item
          }}个</a-button>
        </template> -->



  <!-- 单选框 -->
  <!-- <a-radio-group v-model="activeItem" button-style="solid">
                <a-radio-button value="1">1</a-radio-button>
                <a-radio-button value="2">2</a-radio-button>
                <a-radio-button value="3">3</a-radio-button>
              </a-radio-group> -->



  <!-- <el-button @click="btnClick(1)">第一个</el-button>
                    <el-button @click="btnClick(2)">第二个</el-button>
                    <el-button @click="btnClick(3)">第三个</el-button> -->



  <!-- Home
                        <el-button type="primary" size="default" @click="testAdd">测试+1(go)</el-button>
                        <el-button type="primary" size="default" @click="testAddNode">测试+1(node)</el-button> -->


  <!-- <el-button type="primary" size="default" @click="gob">bbb</el-button> -->

  <!-- <el-button type="primary" size="default" @click="testAxios">测试接口</el-button> -->

  <!-- <button @click="initEchart"></button> -->
  <!-- <div style="width: 0px;height: 400px;display: none;" id="aaa">
                            </div> -->
  <!-- <br />
                            <RouterLink to="/b">b</RouterLink>
                            <br />
                            <RouterLink to="/a">a</RouterLink> -->

  <!-- <RouterView /> -->
  <!-- <Base/> -->
  <!-- <router-view /> -->

  <!-- {{arr[0]}} -->

  
</template>

<style lang='less'></style>